package com.cooper.java.scraper;

import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;

/**
 * Created with IntelliJ IDEA.
 * User: cooperlee
 * Date: 11/15/12
 * Time: 9:47 AM
 */
public class DownloadParams {

    private int connTimeout = 20000;
    private int socketTimeout = 60000;

    private int retryCount = 2;

    public int getConnTimeout() {
        return connTimeout;
    }

    public int getSocketTimeout() {
        return socketTimeout;
    }

    public int getRetryCount() {
        return retryCount;
    }

    public BasicHttpParams createHttpParameters() {
        BasicHttpParams httpParameters = new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(httpParameters, connTimeout);
        HttpConnectionParams.setSoTimeout(httpParameters, socketTimeout);
        return httpParameters;
    }
}
